import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '商场名称',
    align: 'center',
    dataIndex: 'name',
  },
  {
    title: '停车场地址',
    align: 'center',
    dataIndex: 'address',
  },
  {
    title: '经度',
    align: 'center',
    dataIndex: 'longitude',
  },
  {
    title: '纬度',
    align: 'center',
    dataIndex: 'latitude',
  },
  {
    title: '车位编号',
    align: 'center',
    dataIndex: 'number',
  },
  {
    title: '车位状态',
    align: 'center',
    dataIndex: 'status_dictText',
  },
  {
    title: '小时单价',
    align: 'center',
    dataIndex: 'price',
  },
  {
    title: '超1小时单价',
    align: 'center',
    dataIndex: 'overOneHourprice',
  },
  {
    title: '车位大小',
    align: 'center',
    dataIndex: 'size',
  },
  {
    title: '限高',
    align: 'center',
    dataIndex: 'heightPermitted',
  },
  {
    title: '是否充电车位',
    align: 'center',
    dataIndex: 'isRecharge_dictText',
  },
  {
    title: '描述介绍',
    align: 'center',
    dataIndex: 'description',
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '停车场地址',
    field: 'address',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: '车位编号',
    field: 'number',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: '车位状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'subscribe_status',
    },
    //colProps: {span: 6},
  },
  {
    label: '小时单价',
    field: 'price',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: '超1小时单价',
    field: 'overOneHourprice',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: '是否充电车位',
    field: 'isRecharge',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'is_recharge',
    },
    //colProps: {span: 6},
  },
  {
    label: '描述介绍',
    field: 'description',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '商场名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '停车场地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '经度',
    field: 'longitude',
    component: 'Input',
  },
  {
    label: '纬度',
    field: 'latitude',
    component: 'Input',
  },
  {
    label: '车位编号',
    field: 'number',
    component: 'Input',
  },
  {
    label: '车位状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'subscribe_status',
    },
  },
  {
    label: '小时单价',
    field: 'price',
    component: 'InputNumber',
  },
  {
    label: '车位大小',
    field: 'size',
    component: 'Input',
  },
  {
    label: '限高',
    field: 'heightPermitted',
    component: 'Input',
  },
  {
    label: '是否充电车位',
    field: 'isRecharge',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'is_recharge',
    },
  },
  {
    label: '描述介绍',
    field: 'description',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
